package com.kexinde.wjifen.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.kexinde.wjifen.model.Worker;

@Component("workerDao")
public class WorkerDao extends BaseDao<Worker> {

	@SuppressWarnings("unchecked")
	public Worker findByName(String name){
		List<Worker> workers = hibernateTemplate
				.find("from Worker w where w.userName='" + name + "'");
		if (null == workers || 0 == workers.size()) {
			return null;
		}
		return workers.get(0);
	}
}
